function SpriteShape (sprite, x, y) {
    this.sprite = sprite;
    this.x = x;
    this.y = y;
    this.sprite.set({
        x: x,
        y: y
    });
    this.setPolygonPoints();
}

SpriteShape.prototype = (function (o) {
    var s = new Polygon();
    for(var p in o) {
        s[p] = o[p]
    }
    return s;
})({
    /**
     * 精灵形状移动，要同时移动形状框和精灵对象呢
     */
    move: function (dx, dy) {
        var point, x;
        for(var i = 0; i < this.points.length; i += 1) {
            point = this.points[i];
            point.x += dx;
            point.y += dy;
        }
        this.sprite.set({
            x: this.points[0].x,
            y: this.points[0].y
        })
    },

    //重写fill方法
    fill: function (ctx) {
        //不做任何事
    },

    //初始化形状顶点
    setPolygonPoints: function () {
        this.points.push(new Point(this.x, this.y));
        this.points.push(new Point(this.x + this.sprite.width, this.y));
        this.points.push(new Point(this.x + this.sprite.width, this.y + this.sprite.height));
        this.points.push(new Point(this.x, this.y + this.sprite.height));
    },

    //绘制精灵
    stroke: function (ctx) {
        this.sprite.paint(ctx);
    }
})